﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using GameFramework.Materials;
using GameFramework.Audio;

namespace GameFramework.ModelManager
{
    public abstract class ManagedModel 
    {
        public ManagedModel()
        {
        }

        public ManagedModel(Model model, Vector3 position, Vector3 rotation,
            Vector3 scale, GraphicsDevice graphicsDevice)
        {
            this.unmanagedModel = model;

            this.position = position;
            this.rotation = rotation;
            this.scale = scale;

            this.graphicsDevice = graphicsDevice;
        }

        public ManagedModel(ManagedModel instance)
            : this(instance.unmanagedModel, instance.position, instance.rotation, 
            instance.scale, instance.graphicsDevice)
        {
        }

        public abstract void Draw(Matrix view, Matrix projection, Vector3 cameraposition);

        public virtual Vector3 Scale
        {
            get { return scale; }
            set { scale = value; }
        }

        public virtual Vector3 Rotation
        {
            get { return rotation; }
            set { rotation = value; }
        }

        public virtual Vector3 Position
        {
            get { return position; }
            set { position = value; }
        }

        public virtual Model Model 
        {
            get { return unmanagedModel; }
            set { unmanagedModel = value; }
        }

        protected Vector3 position, rotation, scale;
        protected Model unmanagedModel;
        protected GraphicsDevice graphicsDevice;
    }
}
